<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xmlns:cache="http://www.springframework.org/schema/cache"
	xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
	http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd
	http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

	<!-- Root Context: defines shared resources visible to all other web components -->

	<cache:annotation-driven />

	<bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager">
		<property name="caches">
			<set>
				<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" name="hotels" />
				<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" name="hotelsMap" />
				<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" name="allCardType" />
				
			</set>
		</property>
	</bean>

	<bean class="org.apache.commons.dbcp.BasicDataSource" id="ds">
		<property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver" />
		<property name="url" value="jdbc:jtds:sqlserver://192.168.210.118:1433/WeiXinTest" />
		<property name="username" value="sa" />
		<property name="password" value="Motel168" />
	</bean>

	<bean class="org.apache.commons.dbcp.BasicDataSource" id="dsmap">
		<property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver" />
		<property name="url"
			value="jdbc:jtds:sqlserver://192.168.210.38:58885/mapbar" />
		<property name="username" value="sa" />
		<property name="password" value="hotelrj" />
	</bean>

	<bean class="org.apache.commons.dbcp.BasicDataSource" id="dscrs">
		<property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver" />
		<property name="url"
			value="jdbc:jtds:sqlserver://192.168.210.38:58885/CRS" />
		<property name="username" value="sa" />
		<property name="password" value="hotelrj" />
	</bean>

	<bean id="dataSource"  class="deng.qiya.util.DynamicDataSource">
		<property name="targetDataSources">
			<map>
				<entry key="ds" value-ref="ds" />
				<entry key="dsmap" value-ref="dsmap" />
				<entry key="dscrs" value-ref="dscrs" />
			</map>
		</property>
		<property name="defaultTargetDataSource" ref="ds" />
	</bean>
	<bean class="org.springframework.jdbc.core.JdbcTemplate" id="jdbcTemplate">
		<constructor-arg ref="dataSource" /> 
	</bean>

	<bean id="textMessageOper" class="deng.qiya.dao.TextMessageOper"></bean>
	<bean id="hotelOper" class="deng.qiya.dao.HotelOper"></bean>
	<bean id="baiduMap" class="deng.qiya.baidu.BaiduMap"></bean>
	<bean id="mapOper" class="deng.qiya.dao.MapOper"></bean>
	<bean id="textMessageHandler" class="deng.qiya.wechat.TextMessageHandler"></bean>
	<bean id="replyMessageOper" class="deng.qiya.dao.ReplyMessageOper"></bean>
	<bean id="weChatHomeinnsUserOper" class="deng.qiya.dao.WeChatHomeinnsUserOper"></bean>
	<bean id="checkCodeOper" class="deng.qiya.dao.CheckCodeOper"></bean>
	<bean id="cardTypeOper" class="deng.qiya.dao.CardTypeOper"></bean>
	<bean id="weChatMessageHelper" class="deng.qiya.util.WeChatMessageHelper"></bean>
	<bean id="resvHelper" class="deng.qiya.util.ResvHelper"></bean>
	
	<bean id="XMLConverter" class="deng.qiya.util.XMLConverter">
		<property name="marshaller" ref="castorMarshaller" />
		<property name="unmarshaller" ref="castorMarshaller" />
	</bean>

	<bean id="castorMarshaller" class="org.springframework.oxm.castor.CastorMarshaller">
		<property name="mappingLocation" value="classpath:mapping.xml"></property>
	</bean>

	<context:component-scan base-package="deng.qiya"/>
	
</beans>
